//
// Created by FindBin on 2024/6/9.
//

#include "slowStart.h"
#include "bsp_can.h"

void slowStart_allopen(FDCAN_HandleTypeDef *hfdcan, uint8_t id) {
  uint8_t send_msg[8] = {ALL_OPEN, 0, 0, 0, 0, 0, 0, 0};
  fdcan_send_msg(hfdcan, (base_id | id), 8, send_msg);
}
void slowStart_allclose(FDCAN_HandleTypeDef *hfdcan, uint8_t id) {
  uint8_t send_msg[8] = {ALL_CLOSE, 0, 0, 0, 0, 0, 0, 0};
  fdcan_send_msg(hfdcan, (base_id | id), 8, send_msg);
}
void slowStop_ctrl(FDCAN_HandleTypeDef *hfdcan, uint8_t id, uint8_t port_id,
                   uint8_t state) {
  uint8_t send_msg[8] = {CONTROL, port_id, state, 0, 0, 0, 0, 0};
  fdcan_send_msg(hfdcan, (base_id | id), 8, send_msg);
}
